package com.example.exception;

import org.springframework.http.HttpStatus;

public class BusinessException extends RuntimeException{
    public HttpStatus httpStatus;

    public BusinessException(String message, HttpStatus httpStatus){
        super(message);
        this.httpStatus = httpStatus;
    }

    public BusinessException(String message){
        super(message);
        this.httpStatus = HttpStatus.BAD_REQUEST;
    }

    public BusinessException(){
        super("系统内部错误");
        this.httpStatus = HttpStatus.BAD_REQUEST;
    }


    public HttpStatus getHttpStatus() {
        return httpStatus;
    }
}
